<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>权限管理</title>
    <link rel="stylesheet" href="/box/layui/css/layui.css">
    <script src="/box/layui/layui.js"></script>
    <script src="/box/js/jquery-3.3.1.js"></script>
    <script src="/box/js/config.js"></script>
    <link rel="shortcut icon" href="/box/assets/ico/minus.png">
    <style>
        .box-pad {
            padding: 1%;
        }
    </style>
</head>

<body>
    <div class="box-pad">
        <h2>权限列表</h2>
        <hr>
        <table class="layui-table" id="permissionTable" lay-filter="permissionTable"></table>
        <script>
            // layui.config({
            //     base: '/box/layui/lay/modules/'
            // });
            layui.use(['table','tree','treeGrid'], function () {
                var treeGrid = layui.treeGrid;
                $.get(new Config().base_url + '/permission/all', function (data) {
                    treeGrid.render({
                        elem:"#permissionTable",
                        data: data,
                        treeId: 'permissionId',
                        treeUpId: 'parentId',
                        treeShowName: 'name',
                        cols:[[
                            {field: 'name', title: '权限名称'}
                            ,{field: 'url', title: '链接地址'}
                            ,{field: 'type', title: '权限类型'}
                        ]]
                    });
                });
            });
        </script>
    </div>
</body>
</html>